import Vue from 'vue'
import Router from 'vue-router'
// import Header from '@/views/Header.vue'
const Home = () => import(/* webpackChunkName: "Home" */ '@/views/Home.vue')
const Topics = () => import(/* webpackChunkName: "topics" */ '@/views/Topics.vue')
const Topic = () => import(/* webpackChunkName: "topic" */ '@/views/Topic.vue')
// const Page = () => import(/* webpackChunkName: "page" */ '@/views/Page.vue')

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      redirect: '/topics'
    },
    {
      path: '/',
      name: 'home',
      component: Home,
      children: [
        {
          path: 'topics',
          component: Topics
        }
      ]
    },
    {
      path: '/topics/:tid',
      name: 'topic',
      component: Topic,
      // children: [
      //   {
      //     path: '/:tid',
      //     component: Page
      //   }
      // ]
    }
  ]
})
